import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import './assets/css/global.css'
import axios from 'axios';

Vue.config.productionTip = false
//挂在到vue#app
Vue.prototype.$http = axios
// 配置请求的根路径
axios.defaults.baseURL = 'http://192.168.48.1:9001/'

// 每次请求先验证是否携带token
axios.interceptors.request.use( config => {
  config.headers.Authorization = window.sessionStorage.getItem('token');
  console.log(config)
  return config;
})
new Vue({ 
  router,
  render: h => h(App)
}).$mount('#app')
